package com.ruoyi.gis.componets;

import com.aliyun.aiearth_engine20220609.models.ListDatasResponseBody;
import com.ruoyi.gis.task.EarthAiTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class EarthAiComponent {
    private final Logger logger = LoggerFactory.getLogger(EarthAiComponent.class);
    @Autowired
    @Qualifier("aiTaskExecutor")
    private ThreadPoolTaskExecutor taskExecutor;
    public void sendSaveRasterInfoMessage(List<ListDatasResponseBody.ListDatasResponseBodyList> data) {
        if(data==null||data.size()==0)return;
        taskExecutor.submit(new EarthAiTask(data));
    }
}
